<?php
namespace app\index\controller;
use think\Db;
use think\Controller;
use think\captcha;

class Index extends controller
{
    public function index()
    {
  //   	$res = Db::query("select * from user");
  //   	echo "<pre>";
  //   	var_dump($res);

		// // Db::execute();
		// $res = db('user')->where('id',10)->find();

		//    	echo "<pre>";
  //   	var_dump($res);
  //   	
  		
  // 		$data = ['username' => 'admin', 'content' => json_encode(['error'=>0,'info'=>'你登录失败'])];

		// Db::table('log')->insert($data);
		// 
		// // 
		// $res = Db::table('log')->where('content$.error','0')->find();


		//    	echo "<pre>";
  // //   	var_dump($res);
 	// 	return $this->fetch('index',['name'=>'学并思']);
 	// 	
 	return view('index',['name'=>'学并思']);












    }

    public function test()
    {
    	 vendor ('phpQuery.phpQuery');

        \phpQuery::newDocumentFile('http://www.thinkphp.cn/topic/49480.html'); 
      $artlist = pq(".detail-hd .t-head h2")->html();

      var_dump($artlist);
    }
}
